# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataflow.V1b3.Model.StreamingSetupTask do
  @moduledoc """
  A task which initializes part of a streaming Dataflow job.

  ## Attributes

  *   `drain` (*type:* `boolean()`, *default:* `nil`) - The user has requested drain.
  *   `receiveWorkPort` (*type:* `integer()`, *default:* `nil`) - The TCP port on which the worker should listen for messages from other streaming computation workers.
  *   `snapshotConfig` (*type:* `GoogleApi.Dataflow.V1b3.Model.StreamingApplianceSnapshotConfig.t`, *default:* `nil`) - Configures streaming appliance snapshot.
  *   `streamingComputationTopology` (*type:* `GoogleApi.Dataflow.V1b3.Model.TopologyConfig.t`, *default:* `nil`) - The global topology of the streaming Dataflow job.
  *   `workerHarnessPort` (*type:* `integer()`, *default:* `nil`) - The TCP port used by the worker to communicate with the Dataflow worker harness.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :drain => boolean() | nil,
          :receiveWorkPort => integer() | nil,
          :snapshotConfig =>
            GoogleApi.Dataflow.V1b3.Model.StreamingApplianceSnapshotConfig.t() | nil,
          :streamingComputationTopology => GoogleApi.Dataflow.V1b3.Model.TopologyConfig.t() | nil,
          :workerHarnessPort => integer() | nil
        }

  field(:drain)
  field(:receiveWorkPort)
  field(:snapshotConfig, as: GoogleApi.Dataflow.V1b3.Model.StreamingApplianceSnapshotConfig)
  field(:streamingComputationTopology, as: GoogleApi.Dataflow.V1b3.Model.TopologyConfig)
  field(:workerHarnessPort)
end

defimpl Poison.Decoder, for: GoogleApi.Dataflow.V1b3.Model.StreamingSetupTask do
  def decode(value, options) do
    GoogleApi.Dataflow.V1b3.Model.StreamingSetupTask.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataflow.V1b3.Model.StreamingSetupTask do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
